Ext.define('ES.view.archives.ProjectInterest',{
	extend:'Ext.container.Container',
	alias:'widget.projectinterest',
	requires:[],
	width:'100%',
	layout:{
		type:'vbox',
		defaultMargins:{top: 10, right: 0, bottom: 0, left: 10}
	},
	loadInterestData:function(interest){
		var interestBar = Ext.ComponentQuery.query('component[ESName=interestBar]')[0]; 
		interestBar.setWidth((220*interest)/100);
		Ext.ComponentQuery.query('component[ESName=interestValue]')[0].update(interest + '%');
	},
	initComponent:function(){
		this.items = [
			{
				xtype:'component',
				html:'Interest Rate',
				style:{
					fontWeight:'bold',
					fontSize:12,
					color:'#6DB8E0'
				}
			},
			{
				xtype:'component',
				html:'Interest rate based on views/downloads'
			},
			{
				xtype:'container',
				layout:{
					type:'hbox',
					align:'middle'
				},
				width:'100%',
				height:50,
				items:[
					{
						xtype:'component',
						ESName:'interestBar',
						width:'70%',
						html:'&nbsp;',
						height:50,
						style:{
							backgroundColor:'#E4FAA5',
							borderStyle:'solid',
							borderColor:'#D5E79B'
						}
					},
					{
						xtype:'component',
						ESName:'interestValue',
						width:'20%',
						html:'15%',
						height:50,
						style:{
							fontSize:30,
							color:'#6E6E6E',
							fontWeight:'bold'
						}						
					}		
				]
			}			
		]
		this.callParent(arguments)
	}
});
